<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: RubyMotionQuery::Device
  
    &mdash; Documentation by YARD 0.8.7.3
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (D)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../RubyMotionQuery.html" title="RubyMotionQuery (module)">RubyMotionQuery</a></span></span>
     &raquo; 
    <span class="title">Device</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: RubyMotionQuery::Device
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
      
        <ul class="fullTree">
          <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
          
            <li class="next">RubyMotionQuery::Device</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">motion/ruby_motion_query/device.rb</dd>
  
</dl>
<div class="clear"></div>


  <h2>Constant Summary</h2>
  
    <dl class="constants">
      
        <dt id="ORIENTATIONS-constant" class="">ORIENTATIONS =
          
        </dt>
        <dd><pre class="code"><span class='lbrace'>{</span> 
  <span class='const'>UIDeviceOrientationUnknown</span> <span class='op'>=&gt;</span> <span class='symbol'>:unkown</span><span class='comma'>,</span>
  <span class='const'>UIDeviceOrientationPortrait</span> <span class='op'>=&gt;</span> <span class='symbol'>:portrait</span><span class='comma'>,</span>
  <span class='const'>UIDeviceOrientationPortraitUpsideDown</span> <span class='op'>=&gt;</span> <span class='symbol'>:portrait_upside_down</span><span class='comma'>,</span>
  <span class='const'>UIDeviceOrientationLandscapeLeft</span> <span class='op'>=&gt;</span> <span class='symbol'>:landscape_Left</span><span class='comma'>,</span>
  <span class='const'>UIDeviceOrientationLandscapeRight</span> <span class='op'>=&gt;</span> <span class='symbol'>:landscape_right</span><span class='comma'>,</span>
  <span class='const'>UIDeviceOrientationFaceUp</span> <span class='op'>=&gt;</span> <span class='symbol'>:face_up</span><span class='comma'>,</span> 
  <span class='const'>UIDeviceOrientationFaceDown</span> <span class='op'>=&gt;</span> <span class='symbol'>:face_down</span>
<span class='rbrace'>}</span></pre></dd>
      
    </dl>
  







  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#four_inch%3F-class_method" title="four_inch? (class method)">+ (Boolean) <strong>four_inch?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#height-class_method" title="height (class method)">+ (Numeric) <strong>height</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#ipad%3F-class_method" title="ipad? (class method)">+ (Boolean) <strong>ipad?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#iphone%3F-class_method" title="iphone? (class method)">+ (Boolean) <strong>iphone?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#landscape%3F-class_method" title="landscape? (class method)">+ (Boolean) <strong>landscape?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#orientation-class_method" title="orientation (class method)">+ (Object) <strong>orientation</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>:unknown or from ORIENTATIONS.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#portrait%3F-class_method" title="portrait? (class method)">+ (Boolean) <strong>portrait?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#retina%3F-class_method" title="retina? (class method)">+ (Boolean) <strong>retina?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#screen-class_method" title="screen (class method)">+ (UIScreen) <strong>screen</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#simulator%3F-class_method" title="simulator? (class method)">+ (Boolean) <strong>simulator?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#width-class_method" title="width (class method)">+ (Numeric) <strong>width</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  



  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="four_inch?-class_method">
  
    + (<tt>Boolean</tt>) <strong>four_inch?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


45
46
47
48</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 45</span>

<span class='kw'>def</span> <span class='id identifier rubyid_four_inch?'>four_inch?</span>
  <span class='ivar'>@_four_inch</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>==</span> <span class='float'>568.0</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@_four_inch</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
  <span class='ivar'>@_four_inch</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="height-class_method">
  
    + (<tt>Numeric</tt>) <strong>height</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Numeric</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 27</span>

<span class='kw'>def</span> <span class='id identifier rubyid_height'>height</span>
  <span class='ivar'>@_height</span> <span class='op'>||=</span> <span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_screen'>screen</span><span class='period'>.</span><span class='id identifier rubyid_bounds'>bounds</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="ipad?-class_method">
  
    + (<tt>Boolean</tt>) <strong>ipad?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 31</span>

<span class='kw'>def</span> <span class='id identifier rubyid_ipad?'>ipad?</span>
  <span class='ivar'>@_ipad</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='const'>UIDevice</span><span class='period'>.</span><span class='id identifier rubyid_currentDevice'>currentDevice</span><span class='period'>.</span><span class='id identifier rubyid_userInterfaceIdiom'>userInterfaceIdiom</span> <span class='op'>==</span> <span class='const'>UIUserInterfaceIdiomPad</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@_ipad</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
  <span class='ivar'>@_ipad</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="iphone?-class_method">
  
    + (<tt>Boolean</tt>) <strong>iphone?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


36
37
38
39</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 36</span>

<span class='kw'>def</span> <span class='id identifier rubyid_iphone?'>iphone?</span>
  <span class='ivar'>@_iphone</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='const'>UIDevice</span><span class='period'>.</span><span class='id identifier rubyid_currentDevice'>currentDevice</span><span class='period'>.</span><span class='id identifier rubyid_userInterfaceIdiom'>userInterfaceIdiom</span> <span class='op'>==</span> <span class='const'>UIUserInterfaceIdiomPhone</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@_iphone</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
  <span class='ivar'>@_iphone</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="landscape?-class_method">
  
    + (<tt>Boolean</tt>) <strong>landscape?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 64</span>

<span class='kw'>def</span> <span class='id identifier rubyid_landscape?'>landscape?</span>
  <span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_orientation'>orientation</span> <span class='op'>==</span> <span class='symbol'>:landscape_Left</span> <span class='op'>||</span> <span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_orientation'>orientation</span> <span class='op'>==</span> <span class='symbol'>:landscape_right</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="orientation-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>orientation</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns :unknown or from ORIENTATIONS</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'></span>
      
      
      
        
        <div class='inline'>
<p>:unknown or from ORIENTATIONS</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


60
61
62</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 60</span>

<span class='kw'>def</span> <span class='id identifier rubyid_orientation'>orientation</span>
  <span class='const'>ORIENTATIONS</span><span class='lbracket'>[</span><span class='const'>UIDevice</span><span class='period'>.</span><span class='id identifier rubyid_currentDevice'>currentDevice</span><span class='period'>.</span><span class='id identifier rubyid_orientation'>orientation</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:unknown</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="portrait?-class_method">
  
    + (<tt>Boolean</tt>) <strong>portrait?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


68
69
70</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 68</span>

<span class='kw'>def</span> <span class='id identifier rubyid_portrait?'>portrait?</span>
  <span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_orientation'>orientation</span> <span class='op'>==</span> <span class='symbol'>:portrait</span> <span class='op'>||</span> <span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_orientation'>orientation</span> <span class='op'>==</span> <span class='symbol'>:unknown</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="retina?-class_method">
  
    + (<tt>Boolean</tt>) <strong>retina?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


50
51
52
53
54
55
56
57</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 50</span>

<span class='kw'>def</span> <span class='id identifier rubyid_retina?'>retina?</span><span class='lparen'>(</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='ivar'>@_retina</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
    <span class='id identifier rubyid_main_screen'>main_screen</span> <span class='op'>=</span> <span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_screen'>screen</span>
    <span class='ivar'>@_retina</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_main_screen'>main_screen</span><span class='period'>.</span><span class='id identifier rubyid_respondsToSelector'>respondsToSelector</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>displayLinkWithTarget:selector:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_main_screen'>main_screen</span><span class='period'>.</span><span class='id identifier rubyid_scale'>scale</span> <span class='op'>==</span> <span class='float'>2.0</span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='ivar'>@_retina</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="screen-class_method">
  
    + (<tt>UIScreen</tt>) <strong>screen</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>UIScreen</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


17
18
19</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 17</span>

<span class='kw'>def</span> <span class='id identifier rubyid_screen'>screen</span>
  <span class='const'>UIScreen</span><span class='period'>.</span><span class='id identifier rubyid_mainScreen'>mainScreen</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="simulator?-class_method">
  
    + (<tt>Boolean</tt>) <strong>simulator?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


41
42
43</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 41</span>

<span class='kw'>def</span> <span class='id identifier rubyid_simulator?'>simulator?</span>
  <span class='ivar'>@_simulator</span> <span class='op'>||=</span> <span class='op'>!</span><span class='lparen'>(</span><span class='const'>UIDevice</span><span class='period'>.</span><span class='id identifier rubyid_currentDevice'>currentDevice</span><span class='period'>.</span><span class='id identifier rubyid_model'>model</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>simulator</span><span class='regexp_end'>/i</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="width-class_method">
  
    + (<tt>Numeric</tt>) <strong>width</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Numeric</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


22
23
24</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 22</span>

<span class='kw'>def</span> <span class='id identifier rubyid_width'>width</span>
  <span class='ivar'>@_width</span> <span class='op'>||=</span> <span class='const'>Device</span><span class='period'>.</span><span class='id identifier rubyid_screen'>screen</span><span class='period'>.</span><span class='id identifier rubyid_bounds'>bounds</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Sun Dec  8 20:15:51 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.7.3 (ruby-1.9.3).
</div>

  </body>
</html>